﻿using System;
using System.Diagnostics;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch;
using GauntletFramework.Input;
using GauntletFramework.Games;

namespace GauntletFramework.StateManagment.Menu.Menus
{
    public class NewGameMenu : MenuState
    {
        public override bool StartTransition { get { return false; } }
        public override bool EndTransition { get { return false; } }

        public NewGameMenu()
        {
            Type parentType = typeof(GameStarter);

            System.Reflection.Assembly OurAssembly = System.Reflection.Assembly.GetExecutingAssembly();

            MenuItems.Add(new MenuItem(MenuState.MenuFont, "Back", "Action Back Once", new Vector2(100, 50)));

            float Position = 100;
            foreach (Type objectType in OurAssembly.GetExportedTypes())
            {
                if (objectType.BaseType == parentType)
                {
                    GameStarter GS = (GameStarter)System.Reflection.Assembly.GetExecutingAssembly().CreateInstance(objectType.FullName);
                    
                    MenuItems.Add(new MenuItem(GS.NameFont, GS.Name, objectType.FullName, new Vector2(100, Position), GS.NameColor));
                    Position += 50;
                }
            }

        }
    }
}
